package com.xjie.net;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class Client {
    public static void main(String[] args) {
        try
        {
            InetAddress ip = InetAddress.getByName("192.168.34.118");
            System.out.println(ip.isReachable(2000));
            DatagramSocket socket = new DatagramSocket();
            byte[] bytes = "xiaobai是傻逼".getBytes();
            DatagramPacket packet = new DatagramPacket(bytes,bytes.length, InetAddress.getByName("192.168.34.118"),8080);
            socket.send(packet);
        }catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}
